package Boundry.GenericTools;


import java.awt.Color;
import java.awt.SystemColor;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.border.LineBorder;

import Boundry.GenericTools.GenericTabel;
import Boundry.GenericTools.IPanelOperation;
import Boundry.GenericTools.InputPanel;
import Controllers.GlobalData;
import Controllers.GenericToolsForController.PDFDocument;
import Controllers.GenericToolsForController.PDFfile;
import Entity.Request;

import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JTextArea;
import javax.swing.JComboBox;
import javax.swing.JRadioButton;


public class RequestInfoAndInputPanel extends InputPanel{


	public int getMINDAYSALLOWED() {
		return MINDAYSALLOWED;
	}



	public void setMINDAYSALLOWED(int mINDAYSALLOWED) {
		MINDAYSALLOWED = mINDAYSALLOWED;
	}



	public int getMAXDAYSALLOWED() {
		return MAXDAYSALLOWED;
	}



	public void setMAXDAYSALLOWED(int mAXDAYSALLOWED) {
		MAXDAYSALLOWED = mAXDAYSALLOWED;
	}





	protected JTextField taDateOfCreation;
	protected JTextField taInfoSystemName;
	protected JTextField taInitatorName;
	protected JTextPane taExcuse;
	protected JTextPane taCurrentState;
	protected JTextPane taProposedChangs;
	protected JTextPane taNote;
	protected JLabel lbHeader;
	
	protected Request currentRequest;
	protected  int MINDAYSALLOWED;
	protected  int MAXDAYSALLOWED ;
	protected JPanel pnlLowerPanel;
	protected JPanel pnlUpperPanel;

	

	

	
	
	public RequestInfoAndInputPanel() 
	{
		mainPanel.setLocation(0, 11);
		int Width=808, Height=147;
		this.currentRequest = GlobalData.request;
		MINDAYSALLOWED = 3;
		buildGUI();
		setText();
		
	
		
	}

	


	public void setText() {
		if (currentRequest != null)
		{
			if (currentRequest.getCurrentState() != null) taCurrentState.setText(currentRequest.getCurrentState());
			taCurrentState.setEditable(false);
			if (currentRequest.getDayOfCreation() != null) taDateOfCreation.setText(currentRequest.getDayOfCreation().toString());
			taDateOfCreation.setEditable(false);
			if (currentRequest.getExecuse() != null) taExcuse.setText(currentRequest.getExecuse());
			taExcuse.setEditable(false);
			if (currentRequest.getInfoSystem() != null) taInfoSystemName.setText(currentRequest.getInfoSystem().toString());
			taInfoSystemName.setEditable(false);
			if (currentRequest.getInitiator() != null) taInitatorName.setText(currentRequest.getInitiator().toString());
			taInitatorName.setEditable(false);
			if (currentRequest.getNotes() != null) taNote.setText(currentRequest.getNotes().toString());
			taNote.setEditable(false);
			if (currentRequest.getProposedChange() != null) taProposedChangs.setText(currentRequest.getProposedChange());
			taProposedChangs.setEditable(false);
		}
		else
		{
			System.out.println("Warning! Global data request is null in EvaluationReportPanel ");
		}
	}



	public void buildGUI()
	{
		pnlUpperPanel = new JPanel();
		pnlUpperPanel.setLayout(null);
		pnlUpperPanel.setBorder(new LineBorder(new Color(64, 64, 64)));
		pnlUpperPanel.setBackground(SystemColor.window);
		pnlUpperPanel.setBounds(37, 37, 808, 173);
		mainPanel.add(pnlUpperPanel);
		
		JLabel label_1 = new JLabel("Date of creation:");
		label_1.setBounds(23, 54, 120, 14);
		pnlUpperPanel.add(label_1);
		
		taDateOfCreation = new JTextField();
		taDateOfCreation.setEnabled(false);
		taDateOfCreation.setEditable(false);
		taDateOfCreation.setColumns(10);
		taDateOfCreation.setBackground(SystemColor.inactiveCaptionText);
		taDateOfCreation.setBounds(110, 51, 135, 20);
		pnlUpperPanel.add(taDateOfCreation);
		
		JLabel label_3 = new JLabel("Excuse: ");
		label_3.setBounds(283, 26, 120, 14);
		pnlUpperPanel.add(label_3);
		
		JLabel label_4 = new JLabel("Current State:");
		label_4.setBounds(283, 79, 120, 14);
		pnlUpperPanel.add(label_4);
		
		JLabel label_5 = new JLabel("Info System:");
		label_5.setBounds(23, 79, 120, 14);
		pnlUpperPanel.add(label_5);
		
		taInfoSystemName = new JTextField();
		taInfoSystemName.setEnabled(false);
		taInfoSystemName.setEditable(false);
		taInfoSystemName.setColumns(10);
		taInfoSystemName.setBackground(SystemColor.inactiveCaptionText);
		taInfoSystemName.setBounds(110, 79, 135, 20);
		pnlUpperPanel.add(taInfoSystemName);
		
		taInitatorName = new JTextField();
		taInitatorName.setEnabled(false);
		taInitatorName.setEditable(false);
		taInitatorName.setColumns(10);
		taInitatorName.setBackground(SystemColor.inactiveCaptionText);
		taInitatorName.setBounds(110, 23, 135, 20);
		pnlUpperPanel.add(taInitatorName);
		
		JLabel label_6 = new JLabel("Initiator:");
		label_6.setBounds(23, 26, 120, 14);
		pnlUpperPanel.add(label_6);
		
		JLabel label_7 = new JLabel("Proposed Change: ");
		label_7.setBounds(257, 127, 111, 14);
		pnlUpperPanel.add(label_7);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(375, 127, 416, 41);
		pnlUpperPanel.add(scrollPane);
		
		taProposedChangs = new JTextPane();
		scrollPane.setViewportView(taProposedChangs);
		taProposedChangs.setEnabled(false);
		taProposedChangs.setEditable(false);
		taProposedChangs.setBackground(SystemColor.inactiveCaptionText);
		
		JScrollPane scrollPane_1 = new JScrollPane();
		scrollPane_1.setBounds(375, 26, 416, 41);
		pnlUpperPanel.add(scrollPane_1);
		
		taExcuse = new JTextPane();
		scrollPane_1.setViewportView(taExcuse);
		taExcuse.setEnabled(false);
		taExcuse.setEditable(false);
		taExcuse.setBackground(SystemColor.inactiveCaptionText);
		
		JScrollPane scrollPane_2 = new JScrollPane();
		scrollPane_2.setBounds(375, 75, 416, 41);
		pnlUpperPanel.add(scrollPane_2);
		
		taCurrentState = new JTextPane();
		scrollPane_2.setViewportView(taCurrentState);
		taCurrentState.setEnabled(false);
		taCurrentState.setEditable(false);
		taCurrentState.setBackground(SystemColor.inactiveCaptionText);
		
		JScrollPane scrollPane_3 = new JScrollPane();
		scrollPane_3.setBounds(110, 104, 135, 41);
		pnlUpperPanel.add(scrollPane_3);
		
		taNote = new JTextPane();
		scrollPane_3.setViewportView(taNote);
		taNote.setEnabled(false);
		taNote.setEditable(false);
		taNote.setBackground(SystemColor.inactiveCaptionText);
		
		JLabel lblNote = new JLabel("Note:");
		lblNote.setBounds(43, 115, 46, 14);
		pnlUpperPanel.add(lblNote);
		
		lbHeader = new JLabel("View details about request:");
		lbHeader.setBounds(37, 12, 267, 14);
		mainPanel.add(lbHeader);
		
		
		
	
		
	}


	public JLabel getLbHeader() {
		return lbHeader;
	}



	public void setLbHeader(JLabel lbHeader) {
		this.lbHeader = lbHeader;
	}











	public JPanel getPnlLowerPanel() {
		return pnlLowerPanel;
	}



	public void setPnlLowerPanel(JPanel pnlLowerPanel) {
		this.pnlLowerPanel = pnlLowerPanel;
	}



	public JPanel getPnlUpperPanel() {
		return pnlUpperPanel;
	}



	public void setPnlUpperPanel(JPanel pnlUpperPanel) {
		this.pnlUpperPanel = pnlUpperPanel;
	}





	public JTextField getTaDateOfCreation() {
		return taDateOfCreation;
	}

	public void setTaDateOfCreation(JTextField taDateOfCreation) {
		this.taDateOfCreation = taDateOfCreation;
	}

	public JTextField getTaInfoSystemName() {
		return taInfoSystemName;
	}

	public void setTaInfoSystemName(JTextField taInfoSystemName) {
		this.taInfoSystemName = taInfoSystemName;
	}

	public JTextField getTaInitatorName() {
		return taInitatorName;
	}

	public void setTaInitatorName(JTextField taInitatorName) {
		this.taInitatorName = taInitatorName;
	}

	public JTextPane getTaExcuse() {
		return taExcuse;
	}

	public void setTaExcuse(JTextPane taExcuse) {
		this.taExcuse = taExcuse;
	}

	public JTextPane getTaCurrentState() {
		return taCurrentState;
	}

	public void setTaCurrentState(JTextPane taCurrentState) {
		this.taCurrentState = taCurrentState;
	}

	public JTextPane getTaProposedChangs() {
		return taProposedChangs;
	}

	public void setTaProposedChangs(JTextPane taProposedChangs) {
		this.taProposedChangs = taProposedChangs;
	}

	public JTextPane getTaNote() {
		return taNote;
	}

	public void setTaNote(JTextPane taNote) {
		this.taNote = taNote;
	}

	

	public void setDateOfCreation(String taDateOfCreation) {
		this.taDateOfCreation.setText(taDateOfCreation);
	}
	public void setInfoSystemName(String InfoSystemName) 
	{
		this.taInfoSystemName.setText(InfoSystemName);
	}
	public void setInitatorName(String taInitatorName) {
		this.taInitatorName.setText(taInitatorName);
	}
	public void setExcuse(String taExcuse) {
		this.taExcuse.setText(taExcuse);
	}
	public void setCurrentState(String taCurrentState) {
		this.taCurrentState.setText(taCurrentState);
	}
	public void setProposedChangs(String taProposedChangs) {
		this.taProposedChangs.setText(taProposedChangs);
	}
	public void setNote(String taNote) {
		this.taNote.setText(taNote);
	}
	
	public void setHeader(int num)
	{
		lbHeader.setText("The Request Number " + num + " will Be Resume");
	}

	
	


}
